package dsa.ch01;

public class TestScan {
    public static void main(String[] args) {
        int nums[] = new int[] {5, 2, 7, 4, 6, 3, 1};
        for (int i = 0; i < nums.length - 1; i++) {
            for (int j = 0; j < nums.length - i - 1; j++) {
                if (nums[j] > nums[j + 1]) {
                    int temp = nums[j + 1];
                    nums[j + 1] = nums[j];
                    nums[j] = temp;
                }
            }
            for (int k = 0; k < nums.length; k++) {
                System.out.print(nums[k]+",");
            }
            System.out.println();
        }
    }
}
